package com.gmall.product.controller;

import com.gmall.common.result.Result;
import com.gmall.common.utils.PageInfoVo;
import com.gmall.common.utils.R;
import com.gmall.product.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("product")
public class TestController {

    @Autowired
    private TestService testService;

    @Value("${server.port}")
    String port;

    @GetMapping("test")
    public Result<String> test(){
        System.out.println("product服务被调用==>" + port);
        return Result.ok(port);
    }

    @PostMapping("/page")
    public R page(@RequestBody PageInfoVo pageInfoVo){
       return testService.selectPage(pageInfoVo);
    }
}
